﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DLTN.Entities;
using DLTN.Data;

public partial class DichVu_Controls_ControlDichVuGroupContent : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DisplayHotels();
            DisplayInsurance();
            DisplayAbroadSupport();
            DisplayImmigration();
            HienThiTinVanChuyen();
            HienThiVeMayBay();
        }
    }

    // Hiển thị chuyên mục tin tư vấn du học
    private void DisplayAbroadSupport()
    {
        string strHTML = "";
        int TotalRows = 0;
        string WhereClause = "1=1";

        TList<SubChuyenMuc> TList_SubChuyenMuc = DataRepository.SubChuyenMucProvider.GetPaged("TenSubChuyenMuc like N'%" + Common.AbroadSupport + "%'", "ID", 0, 0, out TotalRows);
        if (TList_SubChuyenMuc.Count > 0)
        {
            WhereClause += " and trangthai =1 and IdSubChuyenMuc in (select Id from SubChuyenMuc where Id = " + TList_SubChuyenMuc[0].Id + " )";
            TList<ChuyenMuc> TList_ChuyenMuc = DataRepository.ChuyenMucProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 5, out TotalRows);
            if (TList_ChuyenMuc.Count > 0)
            {
                int j = 1;
                //Phần liệt kê

                for (int i = 0; i <= TList_ChuyenMuc.Count - 1; i++)
                {
                    strHTML += "<div id=\"tour-doc-content-" + j + "\">";
                    strHTML += "<div>";
                    strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left; height:33px;\">";
                    strHTML += "<img src=\"images/dltn/specialTour.png\"></div>";
                    strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\"><a class=\"linkGroupContent\"  href='" + TList_ChuyenMuc[0].IdSubChuyenMuc + "_" + TList_SubChuyenMuc[0].IdLoaiChuyenMuc + "_" + GetTieuDe(TList_SubChuyenMuc[0].TenSubChuyenMuc) + "_SubChuyenMuc.aspx'>" + Common.AbroadSupport.ToUpper() + "</a></div>";
                    strHTML += "<div class=\"date-time\">" + Common.StandardStringjquery(TList_ChuyenMuc[i].NgayCapNhat.ToString("''dd/MM/yyyy, HH:mm 'GMT+7'")) + "</div></div></div>";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\">";
                    strHTML += "<img class=\"radius\" src=\"upload/ChuyenMuc/" + TList_ChuyenMuc[i].AnhDaiDien + "\" border=\"0\" width=\"300\" height=\"150\"></a></div>";
                    strHTML += "<div style=\"text-align: justify; height: 85px; margin-top: 3px\"><span style=\"font-weight: bold; color: red\">";
                    strHTML += "<a class=\"TinTucRight\" href='" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx'>" + TList_ChuyenMuc[i].TieuDe + "</a>";
                    strHTML += "</span>: " + formatString(TList_ChuyenMuc[i].TomTat.ToString(), 250) + "</div>";
                    strHTML += "<div style=\"margin-top: 0px; padding-left: 207px\"><div class=\"seemoreDiv\">";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\" class=\"seemoreText\"><div style=\"padding-top: 2px; padding-left: 2px\">Xem tiếp</div></a>";
                    strHTML += "</div></div></div>";
                    j++;
                }

            }
            else
            {
                strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left\">";
                strHTML += "<img src=\"images/dltn/specialTour.png\"></div>";
                strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\">" + Common.AbroadSupport.ToUpper() + "</div>";
                strHTML += "<div class=\"date-time\"></div></div></div>";
            }
            litAbroadSupport.Text = strHTML;
        }
    }

    // Hiển thị chuyên mục tin khách sạn
    private void DisplayHotels()
    {
        string strHTML = "";
        int TotalRows = 0;
        string WhereClause = "1=1";
        TList<SubChuyenMuc> TList_SubChuyenMuc = DataRepository.SubChuyenMucProvider.GetPaged("TenSubChuyenMuc like N'%" + Common.Hotels + "%'", "ID", 0, 0, out TotalRows);
        if (TList_SubChuyenMuc.Count > 0)
        {
            WhereClause += " and trangthai =1 and IdSubChuyenMuc in (select Id from SubChuyenMuc where Id = " + TList_SubChuyenMuc[0].Id + " )";
            TList<ChuyenMuc> TList_ChuyenMuc = DataRepository.ChuyenMucProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 5, out TotalRows);
            if (TList_ChuyenMuc.Count > 0)
            {
                int j = 1;
                //Phần liệt kê
                for (int i = 0; i <= TList_ChuyenMuc.Count - 1; i++)
                {
                    strHTML += "<div id=\"tour-hot-content-" + j + "\">";
                    strHTML += "<div>";
                    strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left; height:33px;\">";
                    strHTML += "<img src=\"images/dltn/caydua.png\"></div>";
                    strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\"><a class=\"linkGroupContent\"  href='" + TList_ChuyenMuc[0].IdSubChuyenMuc + "_" + TList_SubChuyenMuc[0].IdLoaiChuyenMuc + "_" + GetTieuDe(TList_SubChuyenMuc[0].TenSubChuyenMuc) + "_SubChuyenMuc.aspx'>" + Common.Hotels.ToUpper() + "</a></div>";
                    strHTML += "<div class=\"date-time\">" + Common.StandardStringjquery(TList_ChuyenMuc[i].NgayCapNhat.ToString("''dd/MM/yyyy, HH:mm 'GMT+7'")) + "</div></div></div>";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\">";
                    strHTML += "<img class=\"radius\" src=\"upload/ChuyenMuc/" + TList_ChuyenMuc[i].AnhDaiDien + "\" border=\"0\" width=\"300\" height=\"150\"></a></div>";
                    strHTML += "<div style=\"text-align: justify; line-height:150%; height: 89px; font-family: Tahoma; margin-top: 3px\"><span style=\"font-weight: bold; color: red\">";
                    strHTML += "<a class=\"TinTucRight\" href='" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx'>" + TList_ChuyenMuc[i].TieuDe + "</a>";
                    strHTML += "</span>: " + formatString(TList_ChuyenMuc[i].TomTat.ToString(), 260) + "</div>";
                    strHTML += "<div style=\"margin-top: -5px; padding-left: 207px\"><div class=\"seemoreDiv\">";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\" class=\"seemoreText\"><div style=\"padding-top: 2px; padding-left: 2px\">Xem tiếp</div></a>";
                    strHTML += "</div></div></div>";
                    j++;
                }
            }
            else
            {
                strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left\">";
                strHTML += "<img src=\"images/dltn/caydua.png\"></div>";
                strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\">" + Common.Hotels.ToUpper() + "</div>";
                strHTML += "<div class=\"date-time\"></div></div></div>";
            }
            litHotels.Text = strHTML;
        }
    }

    // Hiển thị chuyên mục tin bảo hiểm
    private void DisplayInsurance()
    {
        string strHTML = "";
        int TotalRows = 0;
        string WhereClause = "1=1";
        TList<SubChuyenMuc> TList_SubChuyenMuc = DataRepository.SubChuyenMucProvider.GetPaged("TenSubChuyenMuc like N'%" + Common.Insurance + "%'", "ID", 0, 0, out TotalRows);
        if (TList_SubChuyenMuc.Count > 0)
        {
            WhereClause += " and trangthai =1 and IdSubChuyenMuc in (select Id from SubChuyenMuc where Id = " + TList_SubChuyenMuc[0].Id + " )";
            TList<ChuyenMuc> TList_ChuyenMuc = DataRepository.ChuyenMucProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 5, out TotalRows);
            if (TList_ChuyenMuc.Count > 0)
            {
                int j = 1;
                //Phần liệt kê
                for (int i = 0; i <= TList_ChuyenMuc.Count - 1; i++)
                {
                    strHTML += "<div id=\"tour-tn-content-" + j + "\">";
                    strHTML += "<div>";
                    strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left; height:33px;\">";
                    strHTML += "<img src=\"images/dltn/caydu.png\"></div>";
                    strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\"><a class=\"linkGroupContent\"  href='" + TList_ChuyenMuc[0].IdSubChuyenMuc + "_" + TList_SubChuyenMuc[0].IdLoaiChuyenMuc + "_" + GetTieuDe(TList_SubChuyenMuc[0].TenSubChuyenMuc) + "_SubChuyenMuc.aspx'>" + Common.Insurance.ToUpper() + "</a></div>";
                    strHTML += "<div class=\"date-time\">" + Common.StandardStringjquery(TList_ChuyenMuc[i].NgayCapNhat.ToString("''dd/MM/yyyy, HH:mm 'GMT+7'")) + "</div></div></div>";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\">";
                    strHTML += "<img class=\"radius\" src=\"upload/ChuyenMuc/" + TList_ChuyenMuc[i].AnhDaiDien + "\" border=\"0\" width=\"300\" height=\"150\"></a></div>";
                    strHTML += "<div style=\"text-align: justify; line-height:150%; height: 89px; font-family: Tahoma; margin-top: 3px\"><span style=\"font-weight: bold; color: red\">";
                    strHTML += "<a class=\"TinTucRight\" href='" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx'>" + TList_ChuyenMuc[i].TieuDe + "</a>";
                    strHTML += "</span>: " + formatString(TList_ChuyenMuc[i].TomTat.ToString(),250) + "</div>";
                    strHTML += "<div style=\"margin-top: -5px; padding-left: 207px\"><div class=\"seemoreDiv\">";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\" class=\"seemoreText\"><div style=\"padding-top: 2px; padding-left: 2px\">Xem tiếp</div></a>";
                    strHTML += "</div></div></div>";
                    j++;
                }
            }
            else
            {
                strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left\">";
                strHTML += "<img src=\"images/dltn/caydu.png\"></div>";
                strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\">" + Common.Insurance.ToUpper() + "</div>";
                strHTML += "<div class=\"date-time\"></div></div></div>";
            }

            litInsurance.Text = strHTML;
        }
    }

    // Hiển thị chuyên mục tin xuất nhập cảnh
    private void DisplayImmigration()
    {
        string strHTML = "";
        int TotalRows = 0;
        string WhereClause = "1=1";
        TList<SubChuyenMuc> TList_SubChuyenMuc = DataRepository.SubChuyenMucProvider.GetPaged("TenSubChuyenMuc like N'%" + Common.Immigration + "%'", "ID", 0, 0, out TotalRows);
        if (TList_SubChuyenMuc.Count > 0)
        {
            WhereClause += " and trangthai =1 and IdSubChuyenMuc in (select Id from SubChuyenMuc where Id = " + TList_SubChuyenMuc[0].Id + " )";
            TList<ChuyenMuc> TList_ChuyenMuc = DataRepository.ChuyenMucProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 5, out TotalRows);
            if (TList_ChuyenMuc.Count > 0)
            {
                int j = 1;
                //Phần liệt kê
                for (int i = 0; i <= TList_ChuyenMuc.Count - 1; i++)
                {
                    strHTML += "<div id=\"tour-ng-content-" + j + "\">";
                    strHTML += "<div>";
                    strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left; height:33px;\">";
                    strHTML += "<img src=\"images/dltn/internationTour.png\"></div>";
                    strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\"><a class=\"linkGroupContent\"  href='" + TList_ChuyenMuc[0].IdSubChuyenMuc + "_" + TList_SubChuyenMuc[0].IdLoaiChuyenMuc + "_" + GetTieuDe(TList_SubChuyenMuc[0].TenSubChuyenMuc) + "_SubChuyenMuc.aspx'>" + Common.Immigration.ToUpper() + "</a></div>";
                    strHTML += "<div class=\"date-time\">" + Common.StandardStringjquery(TList_ChuyenMuc[i].NgayCapNhat.ToString("''dd/MM/yyyy, HH:mm 'GMT+7'")) + "</div></div></div>";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\">";
                    strHTML += "<img class=\"radius\" src=\"upload/ChuyenMuc/" + TList_ChuyenMuc[i].AnhDaiDien + "\" border=\"0\" width=\"300\" height=\"150\"></a></div>";
                    strHTML += "<div style=\"text-align: justify; height: 85px; margin-top: 3px\"><span style=\"font-weight: bold; color: red\">";
                    strHTML += "<a class=\"TinTucRight\" href='" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx'>" + TList_ChuyenMuc[i].TieuDe + "</a>";
                    strHTML += "</span>: " + formatString(TList_ChuyenMuc[i].TomTat.ToString(), 250) + "</div>";
                    strHTML += "<div style=\"margin-top: -5px; padding-left: 207px\"><div class=\"seemoreDiv\">";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\" class=\"seemoreText\"><div style=\"padding-top: 2px; padding-left: 2px\">Xem tiếp</div></a>";
                    strHTML += "</div></div></div>";
                    j++;
                }
            }
            else
            {
                strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left\">";
                strHTML += "<img src=\"images/dltn/internationTour.png\"></div>";
                strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\">" + Common.Immigration.ToUpper() + "</div>";
                strHTML += "<div class=\"date-time\"></div></div></div>";
            }
            litImmigration.Text = strHTML;
        }
    }

    // Hiển thị chuyên mục tin vận chuyển
    private void HienThiTinVanChuyen()
    {
         string strHTML = "";
        int TotalRows = 0;
        string WhereClause = "1=1";
        TList<SubChuyenMuc> TList_SubChuyenMuc = DataRepository.SubChuyenMucProvider.GetPaged("TenSubChuyenMuc like N'%" + Common.VanChuyen + "%'", "ID", 0, 0, out TotalRows);
        if (TList_SubChuyenMuc.Count > 0)
        {
            WhereClause += " and trangthai = 1 and IdSubChuyenMuc in (select Id from SubChuyenMuc where Id = " + TList_SubChuyenMuc[0].Id + " )";
            TList<ChuyenMuc> TList_ChuyenMuc = DataRepository.ChuyenMucProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 5, out TotalRows);
            if (TList_ChuyenMuc.Count > 0)
            {
                int j = 1;
                //Phần liệt kê
                for (int i = 0; i <= TList_ChuyenMuc.Count - 1; i++)
                {
                    strHTML += "<div id=\"van-chuyen-content-" + j + "\">";
                    strHTML += "<div>";
                    strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left; height:33px;\">";
                    strHTML += "<img src=\"images/dltn/caudua.png\"></div>";
                    strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\"><a class=\"linkGroupContent\"  href='" + TList_ChuyenMuc[0].IdSubChuyenMuc + "_" + TList_SubChuyenMuc[0].IdLoaiChuyenMuc + "_" + GetTieuDe(TList_SubChuyenMuc[0].TenSubChuyenMuc) + "_SubChuyenMuc.aspx'>" + Common.VanChuyen.ToUpper() + "</a></div>";
                    strHTML += "<div class=\"date-time\">" + Common.StandardStringjquery(TList_ChuyenMuc[i].NgayCapNhat.ToString("''dd/MM/yyyy, HH:mm 'GMT+7'")) + "</div></div></div>";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\">";
                    strHTML += "<img class=\"radius\" src=\"upload/ChuyenMuc/" + TList_ChuyenMuc[i].AnhDaiDien + "\" border=\"0\" width=\"300\" height=\"150\"></a></div>";
                    strHTML += "<div style=\"text-align: justify; height: 85px; margin-top: 3px\"><span style=\"font-weight: bold; color: red\">";
                    strHTML += "<a class=\"TinTucRight\" href='" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx'>" + TList_ChuyenMuc[i].TieuDe + "</a>";
                    strHTML += "</span>: " + formatString(TList_ChuyenMuc[i].TomTat.ToString(), 250) + "</div>";
                    strHTML += "<div style=\"margin-top: -5px; padding-left: 207px\"><div class=\"seemoreDiv\">";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\" class=\"seemoreText\"><div style=\"padding-top: 2px; padding-left: 2px\">Xem tiếp</div></a>";
                    strHTML += "</div></div></div>";
                    j++;
                }
            }
            else
            {
                strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left\">";
                strHTML += "<img src=\"images/dltn/caydua.png\"></div>";
                strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\">" + Common.VanChuyen.ToUpper() + "</div>";
                strHTML += "<div class=\"date-time\"></div></div></div>";
            }

            ltrVanChuyen.Text = strHTML;
        }
    }

    // Hiển thị chuyên mục vé máy bay
    private void HienThiVeMayBay()
    {
        string strHTML = "";
        int TotalRows = 0;
        string WhereClause = "1=1";
        TList<SubChuyenMuc> TList_SubChuyenMuc = DataRepository.SubChuyenMucProvider.GetPaged("TenSubChuyenMuc like N'%" + Common.VeMayBay + "%'", "ID", 0, 0, out TotalRows);
        if (TList_SubChuyenMuc.Count > 0)
        {
            WhereClause += " and trangthai = 1 and IdSubChuyenMuc in (select Id from SubChuyenMuc where Id = " + TList_SubChuyenMuc[0].Id + " )";
            TList<ChuyenMuc> TList_ChuyenMuc = DataRepository.ChuyenMucProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 5, out TotalRows);
            if (TList_ChuyenMuc.Count > 0)
            {
                int j = 1;
                //Phần liệt kê
                for (int i = 0; i <= TList_ChuyenMuc.Count - 1; i++)
                {
                    strHTML += "<div id=\"ve-may-bay-content-" + j + "\">";
                    strHTML += "<div>";
                    strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left; height:33px;\">";
                    strHTML += "<img src=\"images/dltn/caydu.png\"></div>";
                    strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\"><a class=\"linkGroupContent\"  href='" + TList_ChuyenMuc[0].IdSubChuyenMuc + "_" + TList_SubChuyenMuc[0].IdLoaiChuyenMuc + "_" + GetTieuDe(TList_SubChuyenMuc[0].TenSubChuyenMuc) + "_SubChuyenMuc.aspx'>" + Common.VeMayBay.ToUpper() + "</a></div>";
                    strHTML += "<div class=\"date-time\">" + Common.StandardStringjquery(TList_ChuyenMuc[i].NgayCapNhat.ToString("''dd/MM/yyyy, HH:mm 'GMT+7'")) + "</div></div></div>";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\">";
                    strHTML += "<img class=\"radius\" src=\"upload/ChuyenMuc/" + TList_ChuyenMuc[i].AnhDaiDien + "\" border=\"0\" width=\"300\" height=\"150\"></a></div>";
                    strHTML += "<div style=\"text-align: justify; height: 85px; margin-top: 3px\"><span style=\"font-weight: bold; color: red\">";
                    strHTML += "<a class=\"TinTucRight\" href='" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx'>" + TList_ChuyenMuc[i].TieuDe + "</a>";
                    strHTML += "</span>: " + formatString(TList_ChuyenMuc[i].TomTat.ToString(), 250) + "</div>";
                    strHTML += "<div style=\"margin-top: -5px; padding-left: 207px\"><div class=\"seemoreDiv\">";
                    strHTML += "<a href=\"" + TList_ChuyenMuc[i].Id + "_" + TList_ChuyenMuc[i].IdSubChuyenMuc + "_" + GetTieuDe(TList_ChuyenMuc[i].TieuDe) + "_ChuyenMuc.aspx" + "\" class=\"seemoreText\"><div style=\"padding-top: 2px; padding-left: 2px\">Xem tiếp</div></a>";
                    strHTML += "</div></div></div>";
                    j++;
                }
            }
            else
            {
                strHTML += "<div style=\"float: left; margin-top: 5px;\"><div style=\"float: left\">";
                strHTML += "<img src=\"images/dltn/caydu.png\"></div>";
                strHTML += "<div style=\"float: right; margin-left: 5px;\"><div class=\"chumenunhomtour\">" + Common.VeMayBay.ToUpper() + "</div>";
                strHTML += "<div class=\"date-time\"></div></div></div>";
            }

            ltrVeMayBay.Text = strHTML;
        }
    }

    public string GetTieuDe(object Char)
    {
        string s = Char.ToString();
        return Common.ConvertToUnSign(s);
    }

    public string formatString(string str, int n)
    {
        string kq = "";

        if (str.Length > n)
            kq = str.Substring(0, n + 1) + "...";
        else
            kq = str;

        return kq;
    }
}